import { createRouter, createWebHistory } from 'vue-router'

import Login from "@/views/Login.vue";
import Main from "@/views/Main.vue";
import Register from "@/views/Register.vue"
import All from "@/views/main/All.vue"
import Video from "@/views/main/Video.vue"
import Word from "@/views/main/Word.vue"
import ShareFind from "@/views/share/ShareFind.vue"
import ShareList from "@/views/share/ShareList.vue"
import ShareRes from "@/views/share/ShareRes.vue"
import Recycle from "@/views/recycle/Recycle.vue";

import Im from "@/views/Im.vue";

const routes = [
    {
        name: '登录界面',
        path: '/login',
        component: Login
    },
    {
        name: '注册界面',
        path: '/register',
        component: Register
    },
    {
        name: '网盘界面',
        path: '/',
        component: Main,
        children:[
            {
                name: '首页-全部',
                path: '/mainAll',
                component: All
            },
            {
                name: '首页-视频',
                path: '/mainVideo',
                component: Video
            },
            {
                name: '首页-文档',
                path: '/mainWord',
                component: Word
            },
            {
                name: '分享列表',
                path: '/shareList',
                component: ShareList
            },
            {
                name: '分享查找',
                path: '/shareFind',
                component: ShareFind
            },
            {
                name: '分享结果',
                path: '/shareRes',
                component: ShareRes
            },
            {
                name: '回收站',
                path: '/recycle',
                component: Recycle
            },
            {
                name: '聊天界面',
                path: '/im',
                component: Im
            },

        ]
    },


];

//这里不是通过new来创建，通过createRouter 方法创建，使用的模式不是通过mode来定义
const router = createRouter({
    routes,
    history: createWebHistory(),
})

export default router